<template>
    <div class="content-wrapper">
        <post-list :subjectId="subjectId" :subject="subject" />
    </div>

</template>

<script>

import PostList from '../post/PostList'
import {getDetails} from '../../../../api/bbs/subject'


export default {
    name: 'subjectPostList',
    data() {
        return {
            subject:{}
        };
    },
    created(){
        this.fetchDetails();
    },
    methods:{
        fetchDetails(){
            let that = this;
            getDetails({id: that.subjectId}).then(res=>{
                that.subject = res.data.details;
            })
        }
    },
    components:{PostList},
    props:{
        subjectId: {
            type: String,
            required: false
        }
    },
    watch:{
        "$route":function(to,from){
            if(to.fullPath === this.$route.fullPath){
                this.fetchDetails();
            }
        }
    }
};
</script>

<style scoped>

.content-wrapper{
    height:100%;
    overflow-y: hidden;
}

.content-row{
    height: 100%;
}

.cityTree{
    overflow-y: scroll;
}

.height-init{
    height: 100%;
}

.container{
    height: 100%;
}

.handle-box {
    height: 6.5%;
}

.handle-input {
    width: 120px;
    display: inline-block;
}

.list-table-row{
    height:83%;
}

.table {
    width: 100%;
    height: 100%;
    font-size: 14px;
}
.red {
    color: #ff0000;
}
.mr10 {
    margin-right: 10px;
}
.table-td-thumb {
    display: block;
    margin: auto;
    width: 40px;
    height: 40px;
}
.pagination-self{
    height:10%;
    text-align: right;
    margin-top: 5px;
}
</style>
